#ifndef SWITCHBUTTON_H
#define SWITCHBUTTON_H
#include <QWidget>
#include <QPainter>
#include <QMouseEvent>
#include <QColor>
class SwitchButton : public QWidget
{
    Q_OBJECT
public:
    explicit SwitchButton(QWidget *parent = nullptr,int sz_width = 40,int sz_height = 20);
    void setColor(QColor color1,QColor color2,QColor color3,QColor color4);
public slots:

protected:
    void paintEvent(QPaintEvent *) override;
    void mousePressEvent(QMouseEvent *e) override;
private:
    bool status_isOpen = false;
    int size_width;
    int size_height;
    QColor color_close_background = QColor(190,190,190,255);
    QColor color_close_foregound = QColor(150,150,150,255);
    QColor color_open_background = QColor(100,220,100,255);
    QColor color_open_foregound = QColor(20,150,20,255);;
};
#endif // SWITCHBUTTON_H
